Receive a QRPh payment
Learn how to receive a qrph
payment from your customer.
The QRPh payment method is when customers scan a QRPh code to pay. To complete a QRPh payment, your customer should select QRPh as the payment method and complete the payment from the QRPh participant they want to use.
PayRex currently supports dynamic QRPh to help you receive an accurate amount from your customer.
The QRPh payment flow
At checkout, your customer can select QRPh as the preferred payment method. Once your customer clicks the pay button, A QR code will show and your customer should complete the payment through their preferred QRPh participant. Once your customer completes the payment, PayRex will confirm the successful payment.
Low-code integration
PayRex offers a low-code solution that gives you more payment integration control.
- Checkout: This lets you redirect your customers to a PayRex-hosted checkout page.
- Elements: A UI component that you can embed into your website. When your customer is ready to complete a purchase, you create a PaymentIntent and configure how you want to display payment methods.
Receiving a QRPh payment
To receive a QRPh payment, you must specify that you allow a QRPh payment when creating a payment intent. The example below is for payment intent workflow.
- Node
- PHP
- Python
- Ruby
// Protect your PayRex Secret API key at all costs. One common approach
// to store it in an environment variable.
// Add your PayRex test secret API key.
const payrexSecretApiKey = '';
const payrex = require('payrex-node')(payrexSecretApiKey);
// Create a PaymentIntent with amount and currency
const paymentIntent = await payrex.paymentIntents.create({
// Amount is in cents. The sample below is 100.00.
amount: 10000,
currency: 'PHP',
payment_methods: [
'qrph',
// add more payment methods if this is your preference
],
});
const output = {
clientSecret: paymentIntent.clientSecret,
}
console.log(JSON.stringify(output));
<?php
require_once '../vendor/autoload.php';
// Protect your PayRex Secret API key at all costs. One common approach
// to store it in an environment variable.
// Add your PayRex test secret API key.
$payrexSecretApiKey = '';
$payrex = new \Payrex\PayrexClient($payrexSecretApiKey);
// Create a PaymentIntent with amount and currency
$paymentIntent = $payrex->paymentIntents->create([
// Amount is in cents. The sample below is 100.00.
'amount' => 10000,
'currency' => 'PHP',
'payment_methods' => [
'qrph',
// add more payment methods if this is your preference
],
]);
$output = [
'clientSecret' => $paymentIntent->client_secret,
];
echo json_encode($output);
from payrex import Client as PayrexClient
# Protect your PayRex Secret API key at all costs. One common approach
# to store it in an environment variable.
# Add your PayRex test secret API key.
payrex_secret_api_key = ''
payrex = PayrexClient(payrex_secret_api_key)
# Create a PaymentIntent with amount and currency
payment_intent = payrex.payment_intents.create(
{
# Amount is in cents. The sample below is 100.00.
'amount': 10000,
'currency': 'PHP',
'payment_methods': [
'qrph',
# add more payment methods if this is your preference
]
}
)
output = {
'client_secret': payment_intent.client_secret
}
print(output)
require "payrex-ruby"
# Protect your PayRex Secret API key at all costs. One common approach
# to store it in an environment variable.
# Add your PayRex test secret API key.
payrex_secret_api_key = ""
payrex = Payrex::Client.new(payrex_secret_api_key)
# Create a PaymentIntent with amount and currency
payment_intent = payrex.payment_intents.create(
# Amount is in cents. The sample below is 100.00.
amount: 10000,
currency: "PHP",
payment_methods: [
"qrph",
// add more payment methods if this is your preference
]
)
output = {
clientSecret: payment_intent.client_secret
}
puts output.to_json
Once you specify the qrph
string, PayRex will handle the rest of your customer's payment flow.