Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace basic-card with BobBucks in paymentrequests samples #769

Merged
merged 13 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
17 changes: 8 additions & 9 deletions paymentrequest/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
# PaymentRequest Recipes

- [Credit cards](https://googlechrome.github.io/samples/paymentrequest/credit-cards/) -
a sample that accepts credit card payments and does not request shipping
information.
- [Payment Handler](https://googlechrome.github.io/samples/paymentrequest/payment-handler/) -
a sample that accepts a URL-based payment method.

- [Android Pay](https://googlechrome.github.io/samples/paymentrequest/android-pay/) -
a sample that accepts Android Pay payments and does not request shipping
information.

- [Free shipping](https://googlechrome.github.io/samples/paymentrequest/free-shipping/) -
a sample that accepts credit card payments and provides free shipping worldwide.
a sample that accepts [BobBucks](https://bobbucks.dev) and provides free shipping worldwide.

- [Shipping options](https://googlechrome.github.io/samples/paymentrequest/shipping-options/) -
a sample that accepts credit card payments and provides a couple of shipping
a sample that accepts [BobBucks](https://bobbucks.dev) and provides a couple of shipping
options regardless of shipping address.

- [Dynamic shipping options](https://googlechrome.github.io/samples/paymentrequest/dynamic-shipping/) -
a sample that accepts credit card payments and varies the availability and price
a sample that accepts [BobBucks](https://bobbucks.dev) and varies the availability and price
of shipping options depending on the shipping address.

- [Contact info](https://googlechrome.github.io/samples/paymentrequest/contact-info/) -
a sample that accepts credit card payments and requests user's contact
a sample that accepts [BobBucks](https://bobbucks.dev) and requests user's contact
information: name, phone number, and email address.

- [Can make payment](https://googlechrome.github.io/samples/paymentrequest/can-make-payment/) -
a sample that accepts both Android Pay and credit card payments and checks
whether the browser can make payment.
a sample that accepts both Android Pay and [BobBucks](https://bobbucks.dev) and checks whether the browser can
make payment.

- [Sketch App Stickersheet](https://googlechrome.github.io/samples/paymentrequest/stickersheet/) -
A stickersheet that allows you to design a payments flow in Sketch App.
10 changes: 3 additions & 7 deletions paymentrequest/can-make-payment/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

/**
* Asynchronously builds PaymentRequest for both Android Pay and credit card
* payments, but does not show any UI yet. Succeeds only if can make payments.
* Asynchronously builds PaymentRequest for both Android Pay and BobBucks, but
* does not show any UI yet. Succeeds only if can make payments.
* If you encounter issues when running your own copy of this sample, run 'adb
* logcat | grep Wallet' to see detailed error messages.
*
Expand All @@ -33,9 +33,6 @@ function initPaymentRequest(onSuccess, onFailure) {
return;
}

let networks = ['amex', 'diners', 'discover', 'jcb', 'mastercard', 'unionpay',
'visa', 'mir'];
let types = ['debit', 'credit', 'prepaid'];
let supportedInstruments = [{
supportedMethods: 'https://android.com/pay',
data: {
Expand All @@ -58,8 +55,7 @@ function initPaymentRequest(onSuccess, onFailure) {
},
},
}, {
supportedMethods: 'basic-card',
data: {supportedNetworks: networks, supportedTypes: types},
supportedMethods: 'https://bobbucks.dev/pay',
}];

let details = {
Expand Down
5 changes: 3 additions & 2 deletions paymentrequest/can-make-payment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ <h3>Background</h3>
</p>

<p>
This sample accepts both Android Pay and credit card payments and checks
whether the browser can make payment.
This sample accepts both Android Pay and
<a href="https://bobbucks.dev">BobBucks</a> and checks whether the browser
can make payment.
</p>

{% capture initial_output_content %}
Expand Down
8 changes: 1 addition & 7 deletions paymentrequest/contact-info/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
* @return {PaymentRequest} The PaymentRequest object.
*/
function initPaymentRequest() {
let networks = ['amex', 'diners', 'discover', 'jcb', 'mastercard', 'unionpay',
'visa', 'mir'];
let types = ['debit', 'credit', 'prepaid'];
let supportedInstruments = [{
supportedMethods: 'basic-card',
data: {supportedNetworks: networks, supportedTypes: types},
supportedMethods: 'https://bobbucks.dev/pay',
}];

let details = {
Expand Down Expand Up @@ -82,8 +78,6 @@ function sendPaymentToServer(instrumentResponse) {
*/
function instrumentToJsonString(instrument) {
let details = instrument.details;
details.cardNumber = 'XXXX-XXXX-XXXX-' + details.cardNumber.substr(12);
details.cardSecurityCode = '***';

return JSON.stringify({
methodName: instrument.methodName,
Expand Down
4 changes: 2 additions & 2 deletions paymentrequest/contact-info/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ <h3>Background</h3>
</p>

<p>
This sample accepts credit card payments and requests payer's contact
information: name, phone number, and email address.
This sample accepts <a href="https://bobbucks.dev">BobBucks</a> and requests
payer's contact information: name, phone number, and email address.
</p>

{% capture initial_output_content %}
Expand Down
8 changes: 1 addition & 7 deletions paymentrequest/dynamic-shipping/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
* @return {PaymentRequest} The PaymentRequest object.
*/
function initPaymentRequest() {
let networks = ['amex', 'diners', 'discover', 'jcb', 'mastercard', 'unionpay',
'visa', 'mir'];
let types = ['debit', 'credit', 'prepaid'];
let supportedInstruments = [{
supportedMethods: 'basic-card',
data: {supportedNetworks: networks, supportedTypes: types},
supportedMethods: 'https://bobbucks.dev/pay',
}];

let details = {
Expand Down Expand Up @@ -134,8 +130,6 @@ function sendPaymentToServer(instrumentResponse) {
*/
function instrumentToJsonString(instrument) {
let details = instrument.details;
details.cardNumber = 'XXXX-XXXX-XXXX-' + details.cardNumber.substr(12);
details.cardSecurityCode = '***';

return JSON.stringify({
methodName: instrument.methodName,
Expand Down
4 changes: 2 additions & 2 deletions paymentrequest/dynamic-shipping/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ <h3>Background</h3>
</p>

<p>
This sample accepts credit card payments and varies the availability and price
of shipping options depending on the shipping address.
This sample accepts <a href="https://bobbucks.dev">BobBucks</a> and varies the
availability and price of shipping options depending on the shipping address.
</p>

{% capture initial_output_content %}
Expand Down
8 changes: 1 addition & 7 deletions paymentrequest/free-shipping/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
* @return {PaymentRequest} The PaymentRequest object.
*/
function initPaymentRequest() {
let networks = ['amex', 'diners', 'discover', 'jcb', 'mastercard', 'unionpay',
'visa', 'mir'];
let types = ['debit', 'credit', 'prepaid'];
let supportedInstruments = [{
supportedMethods: 'basic-card',
data: {supportedNetworks: networks, supportedTypes: types},
supportedMethods: 'https://bobbucks.dev/pay',
}];

let details = {
Expand Down Expand Up @@ -94,8 +90,6 @@ function sendPaymentToServer(instrumentResponse) {
*/
function instrumentToJsonString(instrument) {
let details = instrument.details;
details.cardNumber = 'XXXX-XXXX-XXXX-' + details.cardNumber.substr(12);
details.cardSecurityCode = '***';

return JSON.stringify({
methodName: instrument.methodName,
Expand Down
3 changes: 2 additions & 1 deletion paymentrequest/free-shipping/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ <h3>Background</h3>
</p>

<p>
This sample accepts credit card payments and provides free shipping worldwide.
This sample accepts <a href="https://bobbucks.dev">BobBucks</a> and provides
free shipping worldwide.
</p>

{% capture initial_output_content %}
Expand Down
29 changes: 13 additions & 16 deletions paymentrequest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,30 @@ <h3>Background</h3>

<ul>
<li><a href="payment-handler/">Payment Handler</a> - a sample that accepts
the URL-based payment method.</li>
a URL-based payment method.</li>

<li><a href="android-pay/">Android Pay</a> - a sample that accepts Android Pay
payments and does not request shipping information.</li>

<li><a href="free-shipping/">Free shipping</a> - a sample that accepts credit
card payments and provides free shipping worldwide.</li>
<li><a href="free-shipping/">Free shipping</a> - a sample that accepts
<a href="https://bobbucks.dev">BobBucks</a> and provides free shipping
worldwide.</li>

<li><a href="shipping-options/">Shipping options</a> - a sample that accepts
credit card payments and provides a couple of shipping options regardless of
shipping address.</li>
<a href="https://bobbucks.dev">BobBucks</a> and provides a couple of
shipping options regardless of shipping address.</li>

<li><a href="dynamic-shipping/">Dynamic shipping</a> - a sample that accepts
credit card payments and varies the availability and price of shipping
options depending on the shipping address.</li>
<a href="https://bobbucks.dev">BobBucks</a> and varies the availability and
price of shipping options depending on the shipping address.</li>

<li><a href="contact-info/">Contact info</a> - a sample that accepts credit
card payments and requests user's contact information: name, phone number,
and email address.</li>
<li><a href="contact-info/">Contact info</a> - a sample that accepts
<a href="https://bobbucks.dev">BobBucks</a> and requests user's contact
information: name, phone number, and email address.</li>

<li><a href="can-make-payment/">Can make payment</a> - a sample that accepts
both Android Pay and credit card payments and checks whether the browser can
make payment.</li>

<li><a href="https://emerald-eon.appspot.com">Server side</a> - sample that
demonstrates server-side calculation of shipping price and processing
transactions through a payment service provider.</li>
both Android Pay and <a href="https://bobbucks.dev">BobBucks</a> and checks
whether the browser can make payment.</li>

<li><a href="stickersheet/">Stickersheet</a> -
A stickersheet that allows you to design a payments flow in Sketch App.</li>
Expand Down
8 changes: 1 addition & 7 deletions paymentrequest/shipping-options/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
* @return {PaymentRequest} The PaymentRequest object.
*/
function initPaymentRequest() {
let networks = ['amex', 'diners', 'discover', 'jcb', 'mastercard', 'unionpay',
'visa', 'mir'];
let types = ['debit', 'credit', 'prepaid'];
let supportedInstruments = [{
supportedMethods: 'basic-card',
data: {supportedNetworks: networks, supportedTypes: types},
supportedMethods: 'https://bobbucks.dev/pay',
}];

let details = {
Expand Down Expand Up @@ -137,8 +133,6 @@ function sendPaymentToServer(instrumentResponse) {
*/
function instrumentToJsonString(instrument) {
details = instrument.details;
details.cardNumber = 'XXXX-XXXX-XXXX-' + details.cardNumber.substr(12);
details.cardSecurityCode = '***';

return JSON.stringify({
methodName: instrument.methodName,
Expand Down
4 changes: 2 additions & 2 deletions paymentrequest/shipping-options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ <h3>Background</h3>
</p>

<p>
This sample accepts credit card payments and provides a couple of shipping
options regardless of shipping address.
This sample accepts <a href="https://bobbucks.dev">BobBucks</a> and provides
a couple of shipping options regardless of shipping address.
</p>

{% capture initial_output_content %}
Expand Down